package jnunes.stickytest.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import jnunes.stickytest.model.Customer;
import jnunes.stickytest.repository.CustomerRepository;


public class CustomerServiceImpl implements CustomerService {
	
	
	private CustomerRepository customerRepository;

	public CustomerServiceImpl(){
		
	}
	
	public CustomerServiceImpl(CustomerRepository customerRepository){
		System.out.println("We are using constructor injection!");
		
		this.customerRepository = customerRepository;
	}
	
	@Autowired
	public void setCustomerRepository(CustomerRepository customerRepository) {
		System.out.println("We are using setter injection!");
		
		this.customerRepository = customerRepository;
	}

	/* (non-Javadoc)
	 * @see jnunes.stickytest.service.CustomerService#findAll()
	 */
	public List<Customer> findAll() {
		return customerRepository.findAll();
	}



}
